﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OUList.aspx.cs" Inherits="DirectoryWeb.OUList" CodePage="932" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>組織単位リスト</title>
</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
      <table>
        <tr>
          <td>一覧</td>
          <td style="text-align:right"><asp:Label ID="CountLabel" runat="server"></asp:Label>
          </td>
          <td style="width:10px"></td>
          <td>詳細</td>
        </tr>
        <tr>
          <td colspan="2" style="vertical-align:top">
            <asp:UpdatePanel ID="OUUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:TreeView ID="OUTreeView" runat="server" TabIndex="1" Width="240px" EnableClientScript="False" BorderStyle="Solid" BorderWidth="1px" ShowLines="True">
                </asp:TreeView>
              </ContentTemplate>
            </asp:UpdatePanel>
          </td>
          <td>
          </td>
          <td style="vertical-align:top">
            <asp:UpdatePanel ID="DetailUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
              <ContentTemplate>
                <asp:FormView ID="DetailFormView" runat="server" DataSourceID="DetailDataSource" Width="580px">
                  <ItemTemplate>
                    <table>
                      <tr style="height:25px">
                        <td colspan="2" style="width:75px">郵便番号</td>
                        <td>
                          <asp:TextBox ID="PostalCodeTextBox" runat="server" Width="75px" TabIndex="11" MaxLength="8" Text='<%# Bind("PostalCode") %>'></asp:TextBox>
                        </td>
                        <td style="width:75px">都道府県</td>
                        <td>
                          <asp:TextBox ID="PrefectureTextBox" runat="server" Width="75px" TabIndex="12" MaxLength="4" Text='<%# Bind("Prefecture") %>'></asp:TextBox>
                        </td>
                        <td style="width:75px">市区町村</td>
                        <td>
                          <asp:TextBox ID="CityTextBox" runat="server" Width="120px" TabIndex="13" MaxLength="16" Text='<%# Bind("City") %>'></asp:TextBox>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td style="width:45px; vertical-align:top">番地</td>
                        <td colspan="6">
                          <asp:TextBox ID="StreetTextBox" runat="server" TabIndex="14" MaxLength="256" 
                            Width="400px" Height="40px" TextMode="MultiLine" Text='<%# Bind("Street") %>'></asp:TextBox>
                        </td>
                      </tr>
                      <tr>
                        <td>説明</td>
                        <td colspan="6" style="height:25px">
                          <asp:TextBox ID="DescriptionTextBox" runat="server" TabIndex="15" MaxLength="256" 
                            Width="500px" Text='<%# Bind("Description") %>'></asp:TextBox>
                        </td>
                      </tr>
                      <tr style="height:25px">
                        <td>パス</td>
                        <td colspan="6">
                          <asp:Label ID="DisplayPathLabel" runat="server" Text='<%# Eval("DisplayPath") %>'></asp:Label>
                        </td>
                      </tr>
                    </table>
                  </ItemTemplate>
                  <EmptyDataTemplate>
                    <asp:Literal ID="Literal1" runat="server" Text="一覧から組織単位を選択してください。" EnableViewState="False"></asp:Literal>
                  </EmptyDataTemplate>
                </asp:FormView>
                <asp:ObjectDataSource ID="DetailDataSource" runat="server" 
                  OldValuesParameterFormatString="original_{0}" SelectMethod="FindByPath" TypeName="Library.OrganizationalUnit" OnSelected="DetailDataSource_Selected" OnSelecting="DetailDataSource_Selecting">
                  <SelectParameters>
                    <asp:ControlParameter ControlID="OUTreeView" Name="path" PropertyName="SelectedValue" Type="String" />
                  </SelectParameters>
                </asp:ObjectDataSource>
                <asp:Panel ID="DataPanel" runat="server" Visible="False">
                  <table>
                    <tr>
                      <td colspan="2" style="text-align:right">
                        <asp:Label ID="DataCountLabel" runat="server"></asp:Label>
                      </td>
                    </tr>
                    <tr>
                      <td style="width:50px; vertical-align:top">データ</td>
                      <td>
                        <asp:GridView ID="DataGridView" runat="server" AutoGenerateColumns="False" TabIndex="21">
                          <Columns>
                            <asp:BoundField ConvertEmptyStringToNull="False" HeaderText="名前" ReadOnly="True" DataField="Name" >
                              <HeaderStyle BackColor="#FFFFCC" />
                              <ItemStyle Width="200px" Wrap="True" />
                            </asp:BoundField>
                            <asp:BoundField ConvertEmptyStringToNull="False" HeaderText="種類" ReadOnly="True" DataField="Type" >
                              <HeaderStyle BackColor="#FFFFCC" />
                              <ItemStyle Width="105px" Wrap="True" />
                            </asp:BoundField>
                            <asp:BoundField ConvertEmptyStringToNull="False" HeaderText="説明" ReadOnly="True" DataField="Description" >
                              <HeaderStyle BackColor="#FFFFCC" />
                              <ItemStyle Width="280px" Wrap="True" />
                            </asp:BoundField>
                          </Columns>
                          <EmptyDataTemplate>
                            <asp:Literal ID="Literal2" runat="server" Text="なし" EnableViewState="False"></asp:Literal>
                          </EmptyDataTemplate>
                          <EmptyDataRowStyle BackColor="#FFFFCC" />
                        </asp:GridView>
                      </td>
                    </tr>
                  </table>
                </asp:Panel>
              </ContentTemplate>
              <Triggers>
                <asp:AsyncPostBackTrigger ControlID="OUTreeView" EventName="SelectedNodeChanged" />
              </Triggers>
            </asp:UpdatePanel>
          </td>
        </tr>
      </table>
      <asp:Button ID="Button1" runat="server" Text="戻る" TabIndex="51" OnClick="Button1_Click" />
    </div>
  </form>
</body>
</html>
